#include <stdio.h>
#include <unistd.h>
#include <curl/curl.h>
#include "config.h"
#include "xinterface.h"
#include "clock.h"
#include "gweather.h"


int main(int argc, const char *argv[]) {

  char *current_time;
  char status_string[500];
  char weather_string[500];

  curl_global_init(CURL_GLOBAL_ALL);
  /* volume_initialize();  */
  gweather_start();
  for (;;sleep(UPDATE_TIME)) {
    current_time = clock_getcurrenttime();
    get_gweather(weather_string, sizeof(weather_string));
    snprintf(status_string, sizeof(status_string), STATUS_FORMAT, weather_string, current_time);
    xinterface_setstatus(status_string);
    

  }
  return 0;
}
